package com.ruoyi.orderEat.mapper;

import com.ruoyi.orderEat.domain.ShopFlavour;
import com.ruoyi.orderEat.domain.ShopFlavourDTO;
import com.ruoyi.orderEat.domain.ShopFlavourVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商品口味Mapper接口
 *
 * @author DingHao
 * @date 2024-01-12
 */
@Repository
public interface ShopFlavourMapper
{

    /**
     * 查询商品口味
     *
     * @param flavourId 商品口味主键
     * @return 商品口味
     */
    public ShopFlavour selectShopFlavourByFlavourId(Long flavourId);

    /**
     * 根据规格名称查询商品口味
     *
     * @param flavourName 商品口味主键
     * @return 商品口味
     */
    ShopFlavour selectByFlavourName(String flavourName);

    /**
     * 查询商品口味下拉选
     *
     * @param specificationId 商品口味主键
     * @return 商品口味
     */
    List<ShopFlavour> selectFlavourName(Long specificationId);


    /**
     * 查询商品口味列表
     *
     * @param shopFlavourDTO 商品口味
     * @return 商品口味集合
     */
    public List<ShopFlavourVO> selectShopFlavourList(ShopFlavourDTO shopFlavourDTO);


    ShopFlavour selectBySpecificationIdAndFlavourName(@Param("specificationId")Long specificationId,@Param("flavourName")String flavourName);



    /**
     * 新增商品口味
     *
     * @param shopFlavour 商品口味
     * @return 结果
     */
    public int insertShopFlavour(ShopFlavour shopFlavour);

    /**
     * 修改商品口味
     *
     * @param shopFlavour 商品口味
     * @return 结果
     */
    public int updateShopFlavour(ShopFlavour shopFlavour);

    /**
     * 删除商品口味
     *
     * @param flavourId 商品口味主键
     * @return 结果
     */
    public int deleteShopFlavourByFlavourId(Long flavourId);

    /**
     * 批量删除商品口味
     *
     * @param flavourIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteShopFlavourByFlavourIds(Long[] flavourIds);
}
